using UnityEngine;

public class PartickleMagick : MonoBehaviour
{
	public ParticleSystem[] listParticle;

	private void OnEnable()
	{
		if (listParticle != null)
		{
			for (int i = 0; i < listParticle.Length; i++)
			{
				listParticle[i].Simulate(Time.unscaledDeltaTime, false, true);
			}
		}
	}

	public void Init()
	{
		if (listParticle != null)
		{
			for (int i = 0; i < listParticle.Length; i++)
			{
				listParticle[i].Simulate(Time.unscaledDeltaTime, false, true);
			}
		}
	}

	private void Update()
	{
		if (listParticle != null)
		{
			for (int i = 0; i < listParticle.Length; i++)
			{
				listParticle[i].Simulate(Time.unscaledDeltaTime, false, false);
			}
		}
	}

	private void OnDisable()
	{
		if (listParticle != null)
		{
			for (int i = 0; i < listParticle.Length; i++)
			{
				listParticle[i].Stop();
			}
		}
	}
}
